<?php

namespace App\Http\Middleware;

use Closure;
use Illuminate\Support\Facades\Auth;

class Checklogin
{

    public function handle($request, Closure $next)
    {
        if(!Auth::check())
        {
          session()->flash('success','请先登录');
          return redirect('/');
        }

        return $next($request);
    }
}
